/* Copyright 2001,2002,2003 NAH6 BV
 * All Rights Reserved
 *
 *  $Header: /var/lib/cvs/secphone/ui/phone/CallProgressSignalling.h,v 1.5 2003/11/21 12:39:24 itsme Exp $
 *
 *
 */


#ifndef __CALLPROGRESSSIGNALLING_H__

#ifdef _WIN32_WCE
#include "Vibrator.h"
#endif

class CCPhoneDlg;

class CallProgressSignalling /*: public NHThread */ {
public:
    CallProgressSignalling(CCPhoneDlg& dlg);
    ~CallProgressSignalling();

    enum TCallProgressTone {
        CPTONE_NONE,
        CPTONE_DIALING,
        CPTONE_ANSWERING,
        CPTONE_BUSY
    };

    virtual void StartThread();

    void Start(TCallProgressTone tone);
    void Stop();

    void StartKeyExchangeTone();
    void StopKeyExchangeTone();

    void StartRing();
    void StopRing();

    void SignalConnect();

    void PlayComfortNoise();

protected:
    virtual DWORD ThreadProc();
    virtual const char* name() const { return "CallProgressSignalling"; }

private:
    CCPhoneDlg& m_dlg;
#ifdef _WIN32_WCE
    Vibrator    m_vibrator;
#endif

    TCallProgressTone m_tone;
    bool m_bKeyexchange;
    bool m_bRinging;

    void UpdateState();
};

#define __CALLPROGRESSSIGNALLING_H__
#endif
